package cn.yangliu.nacos.management.model;

import java.time.LocalDateTime;

import cn.yangliu.jpa.annotations.JpaQuery;
import cn.yangliu.jpa.enums.QueryTypeEnum;
import cn.yangliu.nacos.comm.constant.GlobalConstants;
import cn.yangliu.nacos.comm.model.PageModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * The type of nacos.
 *
 * @author 问道于盲
 * @date 2020 -01-04
 */
@Data
public class OperationQueryModel extends PageModel {

    /**
     * current class instance's member.
     * The Operator.
     */
    @ApiModelProperty(value = "操作人")
    @JpaQuery
    private String operator;

    /**
     * current class instance's member.
     * The Host.
     */
    @ApiModelProperty(value = "客户端ip")
    @JpaQuery
    private String host;

    /**
     * current class instance's member.
     * The Start time.
     */
    @ApiModelProperty(value = "操作时间范围(开始)")
    @JpaQuery(type = QueryTypeEnum.GT, field = "operateTime")
    @DateTimeFormat(pattern = GlobalConstants.DATETIME)
    private LocalDateTime startTime;

    /**
     * current class instance's member.
     * The End time.
     */
    @ApiModelProperty(value = "操作时间范围(结束)")
    @JpaQuery(type = QueryTypeEnum.LT, field = "operateTime")
    @DateTimeFormat(pattern = GlobalConstants.DATETIME)
    private LocalDateTime endTime;

    /**
     * current class instance's member.
     * The Module.
     */
    @JpaQuery
    @ApiModelProperty(value = "操作模块")
    private String module;

    /**
     * current class instance's member.
     * The Action.
     */
    @JpaQuery
    @ApiModelProperty(value = "操作行为")
    private String action;

    /**
     * current class instance's member.
     * The Operate status.
     */
    @JpaQuery
    @ApiModelProperty(value = "操作结果")
    private boolean operateStatus;

    /**
     * current class instance's member.
     * The Operate level.
     */
    @JpaQuery
    @ApiModelProperty(value = "行为等级")
    private String operateLevel;


}
